import store from 'entry/store'

export default {
    // 需要登录
    needLogin: {
        beforeRouteEnter: (to, from, next) => {
            if (!store.getters.userLogined) {
                $toast.show('请先登录')
                $router.replace({
                    name: 'user_login',
                    params: {
                        redirectName: to.name
                    }
                })
            } else {
                next()
            }
        }
    }
}
